(function(window){
	let Land = window.Land = function() {
		this.x = 0	//x坐标
		this.oImg = myGame.land		//陆地图
		this.height = myGame.c.height * 0.15	//陆地高度
	}
	
	//更新x坐标
	Land.prototype.update = function () {
		this.x -= myGame.pipeSpeed
		//循环
		if(this.x < -this.oImg.width) this.x = 0
	}
	
	//渲染
	Land.prototype.render = function () {
		//平铺
		for (var i =0; i <= Math.ceil(myGame.c.width/this.oImg.width); i++) {
			myGame.ctx.drawImage(
				this.oImg, 
				this.x+this.oImg.width*i,
				myGame.c.height-this.height, 
				this.oImg.width,
				this.oImg.height
			)
		}
		
		//补齐大地
		if(this.oImg.height<this.height){
			myGame.ctx.save()
			myGame.ctx.fillStyle = '#ded895'
			myGame.ctx.fillRect(0,myGame.c.height-this.height+this.oImg.height,myGame.c.width,this.height-this.oImg.height)
			myGame.ctx.restore()
		}
	}
})(window)